﻿

function Onresize(container,height) {

    $("#" + container).attr("style", "height:" + height + "px;margin:0px");
}

function Clear(container) {
    $("#" + container).attr("style", "height:25px;margin:0px");
}


function showMessage(container,message) {
    alert(message);
}




function callMethodtempupload(loader)
{
	var result = loader.xmlDoc.responseText; 
	if(result.indexOf("result code=\"200\"")!=-1){
		var jsonstr = loader.xmlDoc.response;
		var tagdsatrt = jsonstr.indexOf("<d>");
		var tagdend = jsonstr.indexOf("</d>");
		jsonstr = jsonstr.substring(tagdsatrt+3,tagdend);
		jsonstr = eval('('+jsonstr+')');
		var list = jsonstr.vos;
		var propertyid = jsonstr.propertyid;
		var propertyid = propertyid.split(",");
		var html = "";
		$("#file_table_"+propertyid[0]).empty();
		for(var i=0;i<list.length;i++){
			html = html + "<tr id=\"tr_";
			html = html + list[i].id + "\">"
			html = html + "<td>" + list[i].name + "</td>";
			html = html +"<td onclick='deltempfile("+list[i].id+")'> 删除 </td>";
			html = html +"</tr>";
		}
		
		$("#file_table_"+propertyid[0]).append(html);
	}
	
}

function deltempfile(str){
	$("#tr_"+str).remove();
	var url = "addinstance.mo";
	var params1 = "_type=field_event&_comp=main&id="+str+"&_event=onClick&_field=tempdel";
	dhtmlxAjax.post (url,  params1, callMethodtempdel); 
}

function callMethodtempdel(loader){
	var result = loader.xmlDoc.responseText; 
	if(result.indexOf("result code=\"200\"")!=-1){
		
	}
	
}


